package com.googlecode.agscrum.controller.jsf.wrapper;

import com.googlecode.agscrum.model.entity.Item;
import com.googlecode.agscrum.model.entity.Sprint;
import com.googlecode.agscrum.model.entity.Task;

public class SprintWrapper {
	private Object object;
	private String description;

	private String type;

	public SprintWrapper(Object object) {
		setObject(object);
	}

	public void setObject(Object object) {
		this.object = object;
		if (object instanceof Sprint) {
			setDescription(((Sprint) object).getDescription());
			setType("sprint");
		} else if (object instanceof Item) {
			setDescription(((Item) object).getName());
			setType("item");
		} else if (object instanceof Task) {
			setDescription(((Task) object).getName());
			setType("task");
		}
	}

	public Object getObject() {
		return object;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescription() {
		return description;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getType() {
		return type;
	}

}
